public class test2 {
    class Solution {
        public int findMinArrowShots(int[][] points) {
            Arrays.sort(points,(a,b)->Integer.compare(a[0],b[0]));
            int rightRange = points[0][1];
            int res = 1;
            for(int i = 1;i<points.length;i++){
                if(points[i][0]<=rightRange){
                    //重叠
                    rightRange = Math.min(rightRange,points[i][1]);
                }else{
                    res++;
                    rightRange = points[i][1];
                }
            }
            return res;
        }
    }
}
